import service from "@/utils/request.ts";
import {COMPLETE_PRE} from '@/api/port-info.ts'

/**
 * 获取消息通知列表
 * @param params 参数
 */
export async function getNotificationListPageReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/notification/getNotificationListPage',
        method: 'POST',
        data: params
    });
}

/**
 * 保存消息信息
 * @param params 参数
 */
export async function saveNotificationItemReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/notification/saveNotificationItem',
        method: 'POST',
        data: params
    });
}

/**
 * 删除消息信息
 * @param params 参数
 */
export async function delNotificationItemReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/notification/delNotificationItem',
        method: 'POST',
        data: params
    });
}

/**
 * 停用消息信息
 * @param params 参数
 */
export async function stopNotificationItemReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/notification/stopNotificationItem',
        method: 'POST',
        data: params
    });
}

/**
 * 启用消息信息
 * @param params 参数
 */
export async function restartNotificationItemReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/notification/restartNotificationItem',
        method: 'POST',
        data: params
    });
}

/**
 * 获取单体消息信息
 * @param params 参数
 */
export async function getOneNotificationItemReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/notification/getOneNotificationItem',
        method: 'POST',
        data: params
    });
}

/**
 * 立即发送消息
 * @param params 参数
 */
export async function nowSendMessageReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/notification/nowSendMessage',
        method: 'POST',
        data: params
    });
}

/**
 * 修改消息为已读
 * @param params 参数
 */
export async function updateNotificationReadReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/notification/updateNotificationRead',
        method: 'POST',
        data: params
    });
}

/**
 * 获取未读通知信息
 * @param params 参数
 */
export async function getNotReadInfoReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/notification/getNotReadInfo',
        method: 'POST',
        data: params
    });
}